package util;

import java.util.Comparator;

class Student {
	int score;

	public Student(int score) {
		super();
		this.score = score;
	}
}

class Mum implements Comparator<Student>{
    // 前-后 正前大， 负后大， 一样返回0
	@Override
	public int compare(Student o1, Student o2) {
		return o1.score - o2.score;
	}
}

public class ComparatorDemo {
	public static void main(String[] args) {
		Mum m = new Mum();
		Student s1 = new Student(88);
		Student s2 = new Student(99);
		System.out.println(m.compare(s1, s2));
	}
}
